package com.tinycloud.miracll.finance.service.impl;

import com.tinycloud.common.core.utils.DateUtils;
import com.tinycloud.common.datasource.annotation.Slave1;
import com.tinycloud.miracll.finance.domain.ProductCost;
import com.tinycloud.miracll.finance.mapper.ProductCostMapper;
import com.tinycloud.miracll.finance.service.IERPProductCostService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 产品成本Service业务层处理
 * 将计算的结果成本同步到erp
 * @author tiny
 * @date 2021-08-31
 */
@Service
@Slave1
public class ERPProductCostServiceImpl implements IERPProductCostService
{
    @Autowired
    private ProductCostMapper productCostMapper;

    @Override
    public int insertProductCost(ProductCost productCost)
    {
        productCost.setCreateTime(DateUtils.getNowDate());
        return productCostMapper.insertLastProductCost(productCost);
    }

    @Override
    public void deleteLastProductCostByParams(ProductCost productCost) {
        productCostMapper.deleteLastProductCostByParams(null);
    }


}
